/**************************************************************************
 *         Copyright(c) 2007 by Sunplus mMedia  Technology Co., Ltd.       *
 *                                                                         *
 *  This software is copyrighted by and is the property of Sunplus mMedia  *
 *  Technology Co., Ltd. All rights are reserved by Sunplus mMedia Techno- *
 *  logy Co., Ltd. This software may only be used in accordance with the   *
 *  corresponding license agreement. Any unauthorized use, duplication,    *
 *  distribution, or disclosure of this software is expressly forbidden.   *
 *                                                                         *
 *  This Copyright notice "M U S T" not be removed or modified without     *
 *  prior written consent of Sunplus mMedia Technology  Co., Ltd.          *
 *                                                                         *
 *  Sunplus mMedia Technology Co., Ltd. reserves the right to modify this  *
 *  software without notice.                                               *
 *                                                                         *
 *  Sunplus mMedia Technology Co., Ltd.                                    *
 *  19-1, Innovation First Road, Science-Based Industrial Park,            *
 *  Hsin-Chu, Taiwan, R.O.C.                                               *
 *                                                                         *
 **************************************************************************/
#ifndef __HAL_JPEG_H__
#define __HAL_JPEG_H__

/**
 * @filename 	hal_jpeg.h
 * @brief 	The header file of  hal jpeg
 * @author 	Wen-Guo
 * @since 	2007-12-1
 * @date 	2007-12-1
 */


#include "general.h"

/**************************************************************************
 *                           C O N S T A N T S                            *
 **************************************************************************/
#define HAL_JPEG_VLC_BOUND_MARGIN ( 16 )

/**************************************************************************
 *                              M A C R O S                               *
 **************************************************************************/

/**************************************************************************
 *                          D A T A    T Y P E S                          *
 **************************************************************************/

/**************************************************************************
 *                         G L O B A L    D A T A                         *
 **************************************************************************/


/**************************************************************************
 *                 E X T E R N A L    R E F E R E N C E S                 *
 **************************************************************************/

/**************************************************************************
 *               F U N C T I O N    D E C L A R A T I O N S               *
 **************************************************************************/
UINT8 halJpegQTableWrite( UINT8 QTableIndex, UINT8 *yQTable, UINT8 *uvQTable, UINT8 zigzagOpt );
UINT8 halJpegQTableRead( UINT8 *QTableIndex, UINT8 *QTable, UINT8 zigzagOpt );
UINT8 halJpegMjpgTrig( UINT32 VLCAAddr, UINT32 VLCBAddr, UINT8 Option );
void halJpegMjpgAbort( void );
UINT8 halJpegEncode( UINT32 SrcAddr, UINT32 VLCAddr, UINT32 DCTDCAddr, UINT8 Option, UINT8 wait );
UINT8 halJpegDecode( UINT32 SrcAddr, UINT16 SrcHsize, UINT16 SrcVsize, UINT32 DstAddr, UINT8 PbRescalSize, UINT8 Option, UINT16 MCURstNo );
UINT8 halJpgZFactorSet( UINT16 hfactor, UINT16 vfactor, UINT16 SrcWidth, UINT16 SrcHeight, UINT16 DstWidth, UINT16 DstHeight, UINT8 option );
UINT8 halJpgROISet( UINT8 option, UINT16 SrcHsize, UINT16 SrcVsize, UINT16 SrcOffsetX, UINT16 SrcOffsetY, UINT16 DetHsize, UINT16 DetVsize, UINT8 rot );
void halJpegVlcBoundSet( UINT16 enable, UINT32 size );
UINT8 halJpegReadEncodeSize( UINT32 *Compsize );
void halJpegDecodeWait(void);

#endif  /* __HAL_JPEG_H__ */
